// GameDataModels.ts
// 数据模型定义
export interface PlayerInfo {
    id: string;
    name: string;
    level: number;
    exp: number;
    gold: number;
    diamond: number;
    power: number;
    avatar: string;
    title: string; // 爵位
}

// 装备
export interface EquipmentItem {
    id: string;
    type: 'weapon' | 'armor' | 'pants' | 'artifact';
    name: string;
    rarity: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
    level: number;
    attack?: number;
    defense?: number;
    durability: number;
    equipped: boolean;
}

// 坐骑
export interface MountItem {
    id: string;
    name: string;
    type: string;
    level: number;
    exp: number;
    speed: number;
    stamina: number;
    equipped: boolean;
}

// 宠物
export interface PetItem {
    id: string;
    name: string;
    type: string;
    level: number;
    exp: number;
    attack: number;
    defense: number;
    skills: string[];
    state: 'idle' | 'fighting' | 'resting';
}

/**
 * material：材料，consumable：消耗品，equipment：装备，pet：宠物，mount：坐骑
 */
export interface InventoryItem {
    id: string;
    type: 'material' | 'consumable' | 'equipment' | 'pet' | 'mount';
    name: string;
    count: number;
    maxStack: number;
    description?: string; // 新增描述字段
    value?: number;
}

export interface GameData {
    player: PlayerInfo;
    equipment: {
        weapon: EquipmentItem | null; // 武器
        armor: EquipmentItem | null; // 衣服
        pants: EquipmentItem | null; // 裤子
        artifact: EquipmentItem | null; // 法宝
        mount: MountItem | null; // 坐骑
    };
    inventory: InventoryItem[];
    pets: PetItem[];
    mounts: MountItem[];
    lastUpdate: number;
}